From 032449b2a4adcabe5f4bc00bb0281d55a8d84c45 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 24 Oct 2023 23:14:24 -0700 Subject: print button --- .../(app)/payment/[id]/plain/+page.server.js | 6 ++ src/routes/(app)/payment/[id]/plain/+page.svelte | 77 ++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 src/routes/(app)/payment/[id]/plain/+page.server.js create mode 100644 src/routes/(app)/payment/[id]/plain/+page.svelte (limited to 'src/routes/(app)/payment/[id]/plain') diff --git a/src/routes/(app)/payment/[id]/plain/+page.server.js b/src/routes/(app)/payment/[id]/plain/+page.server.js new file mode 100644 index 00000000..1c90ab69 --- /dev/null +++ b/src/routes/(app)/payment/[id]/plain/+page.server.js @@ -0,0 +1,6 @@ +import { auth, get } from '$lib/utils'; + +export async function load({ cookies, params }) { + let payment = await get(`/payments/${params.id}`, auth(cookies)); + return { payment }; +} diff --git a/src/routes/(app)/payment/[id]/plain/+page.svelte b/src/routes/(app)/payment/[id]/plain/+page.svelte new file mode 100644 index 00000000..5ffd1656 --- /dev/null +++ b/src/routes/(app)/payment/[id]/plain/+page.svelte @@ -0,0 +1,77 @@ + + +
+
+ Amount +
+ {f(fiat(a, rate), currency)} +
+
+ + {#if tip} +
+ Tip +
+ {f(fiat(tip, rate), currency)} + ({Math.round((tip * 100) / Math.abs(a))}%) +
+
+ +
+ Total +
+ {f(fiat(a + (tip || 0), rate), currency)} +
+
+ {/if} + +
+ Date +
+ {format(new Date(created), 'MMMM d')}, + {format(new Date(created), 'h:mm aaa')} +
+
+ + {#if type === 'bitcoin'} +
+ Txid +
+
+ {id} +
+
+
+ {/if} +
+ + +
+ -- cgit v1.2.3